import java.sql.*;

public class connexion {
    
    Connection connecterBD(){
        try{
            Class.forName("com.mysql.jdbc.Driver");
            System.out.println("Driver OK");
            String url = "jdbc:mysql://localhost:3306/db_ins";
            String user = "root";
            String password = "";
            Connection cnx = DriverManager.getConnection(url , user , password);
             System.out.println("Connexion OK");
             return cnx ;
        }
        catch(ClassNotFoundException | SQLException e)
        {
            System.err.println(e);
            return null ;
        }
        
    }
    
}
